import request from '@/config/axios'
import { pa } from 'element-plus/es/locale'

export const SofaBasicApi = {
  // 设备统计
  getDevicestatistics: async () => {
    return request.get({ url: '/sofa/device/statistics' })
  },
  // 设备列表分页
  getDevicePage: async (params: any) => {
    return request.get({ url: '/sofa/device/page', params })
  },
  // 获得沙发设备列表
  getSofaDeviceList: async (params?: any) => {
    return request.get({ url: '/sofa/device/list', params })
  },
  // create
  createSofaBasice: async (data: any) => {
    return request.post({ url: '/sofa/device/create', data })
  },
  // 更新列表
  updateSofaBasice: async (data: any) => {
    return request.put({ url: '/sofa/device/update', data })
  },
  // 删除列表
  delSofaBasice: async (data: any) => {
    return request.delete({ url: '/sofa/device/delete', data })
  },
  // 套餐信息分页
  getPackagePage: async (params: any) => {
    return request.get({ url: '/sofa/package/page', params })
  },
  // 新增套餐
  createPackage: async (data: any) => {
    return request.post({ url: '/sofa/package/create', data })
  },
  // 更新套餐
  updatePackage: async (data: any) => {
    return request.put({ url: '/sofa/package/update', data })
  },
  // 删除套餐
  deletePackage: async (params: any) => {
    return request.delete({ url: '/sofa/package/delete', params })
  },
  // 指令
  getPackageList: async (params: any) => {
    return request.get({ url: '/sofa/package/list', params })
  },
  // 操作日志
  getDeviceLogPage: async (params: any) => {
    return request.get({ url: '/sofa/device-log/page', params })
  },
  // 套餐类型
  getPackageTypePage: async (params: any) => {
    return request.get({ url: '/sofa/package-type/page', params })
  },
  // 创建套餐类型
  createPackageType: async (data: any) => {
    return request.post({ url: '/sofa/package-type/create', data })
  },
  // 更新套餐类型
  updatePackageType: async (data: any) => {
    return request.put({ url: '/sofa/package-type/update', data })
  },
  // 删除套餐类型
  deletePackageType: async (params: any) => {
    return request.delete({ url: '/sofa/package-type/delete', params })
  },
  // 使用记录
  getPackageOrderPage: async (params: any) => {
    return request.get({ url: '/sofa/package-order/page', params })
  },
  // 测试接口下发指令sofa/device/command/executeByPackage
  executeByPackage: async (data: any) => {
    return request.post({ url: '/sofa/device/command/executeByPackage', data })
  },
  // 添加指令套餐t
  getDeviceCommandList: async (params: any) => {
    return request.get({ url: '/sofa/device/command/list', params })
  }
}
